<template>
    <!-- <div>封堵白名单</div> -->
    <a-row>
      <a-col>
        <a-card :bordered="false" style="margin-bottom: 10px">
          <!-- 查询区域 -->
          
          <div class="table-page-search-wrapper">
            <a-form-model ref="ruleForm" :model="pageFilter" :label-col="labelCol" :wrapper-col="wrapperCol">
              <a-row style="display:flex">
                <a-col :span="6">
                <a-form-model-item label="批次类型">
                    <a-input placeholder="请输入任务名称" />
                </a-form-model-item>
              </a-col>
                <a-col :span="6">
                <a-form-model-item label="批次号" style="margin-left:0px">
                    <a-input placeholder="请输入任务名称" />
                </a-form-model-item>
                </a-col>
                <a-col :span="6">
                <a-form-model-item label="封堵范围" style="margin-left:0px">
                    <a-range-picker allowClear style="width:100%;" format="YYYY-MM-DD"
                    valueFormat="YYYY-MM-DD" />
                </a-form-model-item>
              </a-col>  
              </a-row>
              
            </a-form-model>
          </div>
        </a-card>
        <a-card :bordered="false">
          <div>
            <a-button type="primary" @click="NewSubmission" style="margin-right:10px">抽取</a-button>
            
            <z-table ref="table" rowKey="id" :showAlert="false" :showSelection="true" :loading="loading"
              :columns="columns" :dataSource="pageData" @selectedRowKey="onSelectedRow" @change="onTableChange">
             
            </z-table>
          </div>
          
        </a-card>
      </a-col>
    </a-row>
  </template>
  
  <script>
  export default {
    data () {
      return {
        show:false,
        labelCol: { span: 5 },
        wrapperCol: { span: 16 },
        loading: false,
        pageFilter: {
          pageNo: 1,
          pageSize: 10,
        },
        pageData: {
            records: [
          {
            realName: "111"
          }
        ]
        },
        columns:[
          {
            title: '序号',
            dataIndex: 'order',
            width: 60,
            align: 'center',
            customRender: (text, record, index) =>
              `${(this.pageFilter.pageNo - 1) * this.pageFilter.pageSize + (index + 1)}` //序号分页后连续
          },
          {
            title: '封堵地址',
            dataIndex: 'phone',
            align: 'center',
          },
          {
            title: '数据来源',
            dataIndex: 'phone',
            align: 'center',
          },
          {
            title: '发现时间',
            dataIndex: 'phone',
            align: 'center',
          },
          {
            title: '管局接收状态',
            dataIndex: 'phone',
            align: 'center',
          },
          {
            title: '管局接收时间',
            dataIndex: 'phone',
            align: 'center',
          },
          {
            title: '移动封堵状态',
            dataIndex: 'phone',
            align: 'center',
          },
          {
            title: '移动封堵时间',
            dataIndex: 'phone',
            align: 'center',
          },
          {
            title: '联通封堵状态',
            dataIndex: 'phone',
            align: 'center',
          },
          {
            title: '联通封堵时间',
            dataIndex: 'phone',
            align: 'center',
          },
          {
            title: '电信封堵状态',
            dataIndex: 'phone',
            align: 'center',
          },
          {
            title: '电信封堵时间',
            dataIndex: 'phone',
            align: 'center',
          },
          {
            title: '批次号',
            dataIndex: 'phone',
            align: 'center',
          },

        ]
      }
    },
    methods: {
      NewSubmission(){
        this.$router.push({
        path: '/plugging/police/InvolvingFraud/NewSubmission',
        query: {}
      })
      },
      // aa(){
      //   this.$router.push({
      //   path: '/plugging/police/InvolvingFraud/EditSubmission',
      //   query: {}
      // })
      // },
      // bb(){
      //   this.$router.push({
      //   path: '/plugging/police/InvolvingFraud/ReportDetails',
      //   query: {}
      // })
      // },
      onQuery() {
        this.pageFilter.pageNo = 1
        this.refreshTable()
        console.log(this.pageData);
      },
      //重置
      onResetForm() {
        this.pageFilter = {
          pageNo: 1,
          pageSize: 10,
          departmentId: this.departmentId
        }
        this.refreshTable()
      },
      onSelectedRow(keys) {
        this.selectKeys = keys
        this.isDisabled = keys.length > 0 ? false : true
      },
      onTableChange(pagination, pageFilter, sorter) {
        let keyMap = { currentPage: 'pageNo' }
        let paginations = Object.keys(pagination).reduce((newData, key) => {
          let newKey = keyMap[key] || key
          newData[newKey] = pagination[key]
          return newData
        }, {})
        this.pageFilter = Object.assign({}, this.pageFilter, paginations)
        this.refreshTable()
      },
    }
  }
  </script>
  
  <style lang="less" scoped>
  .search-wrapper-btn {
    position: absolute;
    right: 8%;
    top: 22px;
    z-index: 100;
  }
  </style>